//
// Created by xinhua on 2021/9/27.
//

#include "Triangle.h"

Triangle::Triangle(float v[3 * 3]) {
    a.x = v[0]; a.y = v[1]; a.z = v[2];
    b.x = v[3]; b.y = v[4]; b.z = v[5];
    c.x = v[6]; c.y = v[7]; c.z = v[8];
}

Triangle::Triangle(const Vector3 &_a, const Vector3 &_b, const Vector3 &_c) {
    a = _a;
    b = _b;
    c = _c;
}

void Triangle::setUpAttribute() {
    vertex = {
            a.x, a.y, a.z,
            b.x, b.y, b.z,
            c.x, c.y, c.z
    };

    color = {
            80/255.0, 70/255.0, 200/255.0, 255/255.0,
            80/255.0, 70/255.0, 200/255.0, 255/255.0,
            80/255.0, 70/255.0, 200/255.0, 255/255.0,
    };
}
